<template>
	<view class="">
		<view class="bg" :class="title != '' ? 'bg-color' : ''">

			<u-icon @click="goBack" size="36" name="arrow-left"></u-icon>
			<view class="title-text">
				<image :src="goodinfo.memberPhoto || infoImg" mode=""></image>
				<text>{{goodinfo.memberName}}</text>
			</view>
			<view class="">
			</view>
		</view>
		<view class="wrap-box">
			<view class="wrap" v-if="goodinfo.image.length>0">
				<u-swiper :list="goodinfo.image" mode="rect" height="750" name="image">
					
				</u-swiper>
			</view>
			<view class="bot">
				<view class="bot-time">
					{{goodinfo.createTime}}
				</view>
				<view class="bot-review">
					{{goodinfo.content}}
				</view>
				<view class="bot-img" @click="goProduct">
					<image :src="goodDetails.photoUrl.split(',')[0] || infoImg" mode=""></image>
					<view class="box">
						<view class="">
							已购
							<!-- <text>{{goodDetails.title}}</text> -->
						</view>
						<view class="">
							{{goodDetails.title}}
			
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import config from "../../utils/config";
	import {
		goodsOrderEvaluate,
		getgoodDetails
	} from '../../service/api.js'
	export default {
		onLoad(options) {

			if (options.id) {
				this.getproducts(options.goodsid);
				this.getevaluate(options.id);
			}

		},
		data() {
			return {
				infoImg: config.ossHost + "2025/01/06/0f26de75078d48d0853a65ff9709b6e0.png",
				title: 'kjhfajh ',
				goodDetails: {},
				goodinfo: {},
				list: [{
						image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
						title: '昨夜星辰昨夜风，画楼西畔桂堂东'
					},
					{
						image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
						title: '身无彩凤双飞翼，心有灵犀一点通'
					},
					{
						image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
						title: '谁念西风独自凉，萧萧黄叶闭疏窗，沉思往事立残阳'
					}
				],
			}
		},

		methods: {
			goBack() {


				uni.navigateBack({
					delta: 1,
				});




			},




			//请求药品信息
			async getproducts(id) {

				let res = await getgoodDetails(id)
				if (res.code == 200) {
					this.goodDetails = res.data;
					
					

				}
			},
			goProduct() {
				uni.navigateTo({
					url: '/integration/productList/index'
				})
			},
			async getevaluate(id) {
				let res = await goodsOrderEvaluate(id)
				if (res.code == 200) {
					this.goodinfo=res.data;
					if (this.goodinfo.photo) {
						let image = this.goodinfo.photo.split(','); // 将 photo 按逗号分割成数组
					
						this.goodinfo.image = image; // 将第一个 URL 赋值给 image
						console.log(this.goodinfo);
					}
					console.log(res, "1111111111111111111");
				}
			},
		}

	}
</script>

<style lang="scss" scoped>
	.u-swiper-indicator {
		padding: 0 0 !important;
		bottom: 5rpx;
		right: 5rpx;
	}

	.bot {
		padding: 24rpx;
		background: #FFFFFF;
		border-radius: 16rpx 16rpx 0rpx 0rpx;

		.bot-time {
			margin-top: 24rpx;
			font-size: 20rpx;
			color: #808080;
		}

		.bot-review {
			margin-top: 32rpx;
			font-size: 24rpx;
			color: #1A1A1A;
		}

		.bot-img {
			margin-top: 48rpx;
			display: flex;
			align-items: center;
			padding: 24rpx;
			background: #F5F3F0;
			border-radius: 8rpx;

			image {
				width: 100rpx;
				height: 100rpx;
				border-radius: 8rpx;
			}

			.box {
				margin-left: 16rpx;

				view:first-child {}

				view:last-child {
					margin-top: 16rpx;
					font-size: 24rpx;
					color: #808080;
				}
			}
		}
	}

	.bg {
		width: 100%;
		height: 120rpx;
		display: flex;
		align-items: center;
		padding: 0 24rpx;
		padding-top: 65rpx;
		.title-text {
			display: flex;
			align-items: center;
			margin-left: 20rpx;
			image {
				width: 50rpx;
				height: 50rpx;
				margin-right: 10rpx;
			}
		}

		text {
			

			color: #1a1a1a;
			font-size: 28rpx;
			font-weight: bold;
		}

		
	}

	.bg-color {
		// background: #fff;
	}
	.wrap-box{
		height: calc(100vh - 190rpx);
		background-color: #FFFFFF;
	}
</style>